<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ include file="../../../inc/global.jsp" %>
<%@ include file="../../top.jsp" %>
<compress:html compressCss="true" compressJavaScript="true" enabled="true" >
<!doctype html>
<html>
<head>
    <title><fmt:message key="jsp.title.mall.admin.search.index"/></title>
    <%@ include file="../head.jsp" %>
    <style type="text/css">
        table tr td em {display: inline-block; margin: 0 3px; color:#000;}
    </style>
    <script type="text/javascript">
        $(function() {
            //tableTrMouseOver($('table tr'));
            $('#build').click(function(){
                var btn = this;
                $(btn).attr("disabled","disabled").val('索引生成中，请稍候...');
                $.ajax({
                    type:"POST",
                    url:'/mall/ajax/adm/search/index',
                    success:function(data){
                        var json  = $.parseJSON(data);
                        if(json.succeed) {
                            $(btn).removeAttr("disabled").val('索引完成！');
                        } else{
                            $(btn).attr("disabled","disabled").val('索引失败，请请重新尝试或联系管理员！');
                        }
                    },
                    error:function(){
                        $(btn).removeAttr("disabled").val('索引失败，请请重新尝试或联系管理员！');
                    }
                })
            });
        });// all ready
    </script>
</head>
<body>
<div id="dialog-confirm">

</div>
<div class="main">
    <div class="wrapper">
        <%@include file="../../header.jsp" %>
        <%@include file="../sidebar.jsp"%>
        <!-- sidebar end -->
        <div class="content item-form">
            <div class="menu-tab">
                <ul>
                    <li class="slt"><a href="/mall/adm/search/index"><fmt:message key="jsp.menu-tab.mall.admin.search.index"/></a></li>
                </ul>
            </div>
            <table>
                <tr>
                    <th></th>
                    <td>
                        <label for="rebuild_1"><input type="radio" id="rebuild_1" name="rebuild" value="true">重建索引</label>
                        <label for="rebuild_0"><input type="radio" id="rebuild_0" name="rebuild" value="false">追加索引</label>
                    </td>
                </tr>
                <tr>
                    <th></th>
                    <td>
                        <input type="submit" id="build" value="开始索引"/>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
</body>
</html>
<%@ include file="../../bottom.jsp" %>
</compress:html>